Skip to content

Conversation

@denialhaag
Copy link
Member

Description

This PR fixes the argument names of the build method of most operations, after I had eroneously simplified them. This will silence warnings in IDEs (see #1464 (review)).

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@denialhaag denialhaag self-assigned this Jan 18, 2026
@denialhaag denialhaag added fix Fix for something that isn't working MLIR Anything related to MLIR labels Jan 18, 2026
@denialhaag denialhaag requested a review from burgholzer January 18, 2026 22:41
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Refactor
    • Updated internal parameter naming conventions across quantum operation builder functions for improved code consistency and maintainability. No changes to user-facing functionality or APIs.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Systematically renames the builder and state parameters to odsBuilder and odsState across 29 build method implementations in the QC and QCO quantum gate operation files, propagating these changes through all internal usages including helper calls and recursive builds.

Changes

Cohort / File(s) Summary
QC Dialect Single-Parameter Gates
mlir/lib/Dialect/QC/IR/Operations/StandardGates/GPhaseOp.cpp, POp.cpp, RXOp.cpp, RYOp.cpp, RZOp.cpp
Parameter rename (builder/state → odsBuilder/odsState) in build methods with single theta/angle parameter, updated internal variantToValue and build calls.
QC Dialect Two-Parameter Gates
mlir/lib/Dialect/QC/IR/Operations/StandardGates/ROp.cpp, RXXOp.cpp, RYYOp.cpp, RZXOp.cpp, RZZOp.cpp
Parameter rename in build methods handling two variant parameters (theta/phi), with corresponding updates to operand construction and recursive calls.
QC Dialect Multi-Parameter Gates
mlir/lib/Dialect/QC/IR/Operations/StandardGates/U2Op.cpp, UOp.cpp, XXMinusYYOp.cpp, XXPlusYYOp.cpp
Parameter rename in build methods with multiple variant parameters, propagated through all variantToValue conversions and build delegations.
QCO Dialect Single-Parameter Gates
mlir/lib/Dialect/QCO/IR/Operations/StandardGates/BarrierOp.cpp, GPhaseOp.cpp, POp.cpp, RXOp.cpp, RYOp.cpp, RZOp.cpp
Parameter rename in QCO build methods; RZOp also updates internal builder/state references in operand construction.
QCO Dialect Multi-Parameter Gates
mlir/lib/Dialect/QCO/IR/Operations/StandardGates/ROp.cpp, RXXOp.cpp, RYYOp.cpp, RZXOp.cpp, RZZOp.cpp, U2Op.cpp, UOp.cpp, XXMinusYYOp.cpp, XXPlusYYOp.cpp
Parameter rename in QCO build methods; RZXOp additionally updates getCanonicalizationPatterns signature to accept MLIRContext\* context parameter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested labels

refactor, c++

Suggested reviewers

  • burgholzer

Poem

🐰 The builder hops with name so new,
odsBuilder, odsState shining through,
From QC gates to QCO's door,
Twenty-nine ops renewed once more!
Parameters aligned in quantum dance—
Refactored with precision's glance.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing argument names of build methods across multiple operation implementations.
Description check ✅ Passed The PR description explains the purpose (fixing argument names to silence IDE warnings), references a related issue, and completes most checklist items appropriately.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@burgholzer burgholzer added this to the MLIR Support milestone Jan 18, 2026
@burgholzer burgholzer merged commit d145c3e into main Jan 18, 2026
30 checks passed
@burgholzer burgholzer deleted the fix-argument-names branch January 18, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix for something that isn't working MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants